package com.grep.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.grep.extra.dao.impl.TaskDAOSQL;

public class Modfi_taskurl extends HttpServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		TaskDAOSQL taskDAOSQL = new TaskDAOSQL();

		String id = request.getParameter("urlid");
		String urllink = request.getParameter("urllink");

		String updatesql = "update task_urls set task_url='" + urllink
				+ "' where id='" + id + "'";

		boolean issuccess = taskDAOSQL.insertTask(updatesql);
		String url = "common/success.jsp?issuccess=" + issuccess;
		response.sendRedirect(url);
	}

	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);

	}

}
